﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace Excel2Words
{
    /// <summary>
    /// 
    /// </summary>
    public partial class MainFrm : Form
    {
        /// <summary>
        /// 
        /// </summary>
        public MainFrm()
        {
            InitializeComponent();

            //
            Icon = Properties.Resources.Excel2Word;
            Text = AppHelp.Title + "【更新于 " + AppHelp.Version_Date + " " + AppHelp.Version_Time + "】";

            //
            Load += MainFrm_Load;
            ucExcelImport1.ExcelFileChanged += ucExcelImport1_ExcelFileChanged;
        }

        /// <summary>
        /// 成功加载了新Excel文件
        /// </summary>
        void ucExcelImport1_ExcelFileChanged(object sender, EventArgs e)
        {
            DataTable table = ucExcelImport1.ExcelTable;
            
            stateLbl_1.Text = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "   加载了" + table.Rows.Count + "行数据";
            ucWordExport1.SetExcelTable(table);
        }

        void MainFrm_Load(object sender, EventArgs e)
        {
            LblReadMeApp.Text = AppHelp.TEXT_Read_App;
        }


    }
}
